import 'package:flutter/material.dart';

//Flutter Container 容器 基本使用
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    //脚手架
    return DefaultTabController(
      length: 8,
      initialIndex: 4,
      child: Scaffold(
        appBar: AppBar(
          title: Text('标题'),
          backgroundColor: Colors.blue,
          foregroundColor: Colors.white,
        ),
        body: Center(
          child: Container(
            width: 200,
            height: 200,
            // color: ,
            decoration: BoxDecoration(
              color: Colors.grey,
              //圆角
              borderRadius: BorderRadius.only(topLeft: Radius.circular(40)),
              //边框
              border: Border.all(color: Colors.red, width: 2),

              //背景图片
              // image: DecorationImage(
              //   image: AssetImage('asset/images/user_info.png'),
              //   fit: BoxFit.fill,
              // ),
              boxShadow: [
                BoxShadow(
                  color: Colors.black,
                  blurRadius: 10,
                  spreadRadius: 2.0,
                  offset: Offset(0, 2),
                ),
                BoxShadow(
                  color: Colors.red,
                  blurRadius: 10,
                  spreadRadius: 2.0,
                  offset: Offset(0, 2),
                ),
              ],

              // border: Border(
              //   top: BorderSide(color: Colors.red, width: 2),
              //   right: BorderSide(color: Colors.blue, width: 4),
              // ),
              //默认从左向右  线性渐变
              // gradient: LinearGradient(
              //   colors: [Colors.blue, Colors.red],
              //   begin: Alignment.topLeft,
              //   end: Alignment.bottomRight,
              // ),

              //径向渐变
              // gradient: RadialGradient(
              //   colors: [Colors.blue, Colors.red],
              //   center: Alignment.topLeft,
              //   radius: 0.8,
              // ),
              //扫描渐变
              // gradient: SweepGradient(
              //   colors: [Colors.blue, Colors.red],
              //   center: Alignment.centerRight,
              // ),
            ),
          ),
        ),
        // This trailing comma makes auto-formatting nicer for build methods.
      ),
    );
  }
}
